---
title: "POD Mount"
categories:
- devops
- kubernetes
tags:
---

<div id="content">
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orge74b113">Mount Secrets</a></li>
</ul>
</div>
</div>
<div class="outline-2" id="outline-container-orge74b113">
<h2 id="orge74b113">Mount Secrets</h2>
<div class="outline-text-2" id="text-orge74b113">
<div class="org-src-container">
<pre class="src src-yaml">apiVersion: v1
data:
  mysql-password: SHkYllGjFXYg==
  mysql-root-password: ZGvQmtQXI5w==
kind: Secret
metadata:
  labels:
    app: release-name-mysql
  name: release-name-mysql
  namespace: test
type: Opaque
</pre>
</div>
<div class="org-src-container">
<pre class="src src-yaml">...
     terminationMessagePolicy: File
	  volumeMounts:
	    - mountPath: /app/mysql-key
	      name: volume-1562725616002
      volumes:
	- name: volume-1562725616002
	  secret:
	    defaultMode: 420
	    secretName: release-name-mysql
</pre>
</div>
<p>
Docker file system:
</p>
<div class="org-src-container">
<pre class="src src-sh">
$ tree
/app/mysql-key
  <span style="font-style: italic;">\_</span> mysql-password <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">文件的内容是密码</span>
  <span style="font-style: italic;">\_</span> mysql-root-password

$ cat /app/mysql-key/mysql-password
<span style="font-weight: bold; font-style: italic;">SHkYllGjFXYg</span>==

</pre>
</div>
</div>
</div>
</div>
<div class="status" id="postamble">
<p class="author">Author: amo</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
